@extends('users.app')
@section('title', '用户中心')
@section('style')
<style type="text/css">
.notices{
      box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.1);
  background-color: #489ce7;
  border-radius: 3px;
  margin-bottom: 20px;
}
.notices-header{
    background-color: transparent;
    color: #ffffff;
    border: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.5) !important;
    border-radius: 0;
    padding: 10px 20px;
}
.notices-title {
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0;
    margin-top: 0;
    color: inherit;
}
.notices-body {
    color: rgba(255,255,255,.85);
    padding: 20px;
}
.notices-body p{
  margin: 0px;
  color: rgba(255,255,255,.85);
}
.page-header {
  padding-bottom: 9px;
margin: 40px 0 20px;
border-bottom: 1px solid #eee;
}
</style>
@stop
@section('content')
  <div class="row">
    <div class="col-sm-12">
      <h4 class="page-header">首页</h4>
    </div>
  </div>
  <div class="col-sm-12">
        @if($notices->count())
          @foreach($notices as $notice)
            <div class="notices">
              <div class="notices-header">
                <h3 class="notices-title">{{$notice->title ?: '公告'}}</h3>
              </div>
              <div class="notices-body">
                <p class="card-text">{{ $notice->content }}</p>
                @if( $user->hasRole('Founder'))


              <form class="mt-1" action="{{ route('notices.destroy', $notice->id) }}" method="POST" onsubmit="return confirm('Delete? Are you sure?');">
                {{csrf_field()}}
                <input type="hidden" name="_method" value="DELETE">

                <button type="submit" class="btn btn-sm btn-danger">删除</button>
              </form>
              @endif
            </div>
          </div>
          @endforeach
        {!! $notices->render() !!}
        @else
        <h3 class="text-xs-center alert alert-info">暂无通知!</h3>
        @endif
        @include('feed_backs.create_and_edit')
  </div>
@endsection
